package rp;

import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class CMPMain implements TabCompleter {
    private String[] r = {"help", "menu"};
    @Override
    public List<String> onTabComplete(CommandSender sender, Command cmd, String label, String[] args) {
        if (args.length > 2)
            return new ArrayList<>();
        if (args.length == 1)
            return Arrays.asList(r);
        return Arrays.stream(r).filter(s -> s.startsWith(args[0])).collect(Collectors.toList());
    }
}
